
#ifndef __DEFORMATION_SHAPE_VSGPU_H_
#define __DEFORMATION_SHAPE_VSGPU_H_

#include "glslkernel.h"
#include "./mlsdeformer/typedefs.h"
#include "./mlsdeformer/constraints.h"
#include "./mlsdeformer/deformation.h"
#include "./mlsdeformer/shape3D.h"
#include "./mlsdeformer/weightsScheme.h"

namespace MLS {

/// This class implements the MLS deformation process
/// using the GPU capabilities of the vertex shader processor
class DeformationShape_VSGPU : public Deformation {
   
public:
   DeformationShape_VSGPU();
   ~DeformationShape_VSGPU();
   
   void setting(Shape3D *model, const MLS::Constraints *constraints);
   
   /// Executes the MLS-deformation induced by the deformed constraints positions
   ///@param constraints the deformed constraints 
   void execute_deformation(const MLS::Constraints *constraints);
   
   /// Actives/Desactives the kernel shader
   /// @param f the boolean flag
   void use(bool f) { kernel.use(f); }
   
private:
   Shape3D                  *model;
   
   GLSLKernel                kernel;
   GLuint                    texPpoints;
   GLuint                    texQpoints;
};

} // end MLS namespace

#endif
